﻿using Abp.Authorization.Users;
using Abp.Extensions;
using Microsoft.AspNetCore.Identity;
using Microsoft.Extensions.Options;
using System;
using System.ComponentModel.DataAnnotations.Schema;

namespace AbpProjectTemplate.Domain.Users
{
    public abstract class User : AbpUser<User>
    {
        public static readonly PasswordHasher<User> PasswordHasher = new PasswordHasher<User>(new OptionsWrapper<PasswordHasherOptions>(new PasswordHasherOptions()));

        [Column(TypeName = "nvarchar(24)")]
        public UserType UserType { get; set; }

        public static string CreateRandomPassword()
        {
            return Guid.NewGuid().ToString("N").Truncate(16);
        }
    }
}

